<#global staticPath = "${request.contextPath}">
<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1, user-scalable=no, minimal-ui" name="viewport">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta http-equiv='Content-type' content='text/html; charset=utf-8'/>
	<meta name='format-detection' content='telephone=no'/>
	<meta name='apple-touch-fullscreen' content='yes'/>
	<title>车次管理</title>
	<link rel="stylesheet" href="${staticPath}/css/index.css">
	<script type="text/javascript" src="${staticPath}/js/jquery-1.10.2.min.js"></script>
</head>
<body>
	<header>
		<div class="header_box">
			<div class="header_b">
				<img src="${staticPath}/image/tielu.png" alt="">
				<div class="header_bcenter">车次列表查看</div>
			</div>
		</div>
	</header>
	
	<div class="content">
		<!--搜索 -->
		<div class="content_search">
			
			<div class="content_seatitle">条件搜索</div>
			<div class="content_seakuang">
			<form id="searchForm" class="form-inline no-margin" action="/train/list" method="post">
				<div class="content_seaever">
					<span>车次:</span>
					<input type="text" name="trainName" value="${(train.trainName)!}">
				</div>
				<div class="content_seaever">
					<span>始发站:</span>
					<select name="startStationId" id="startStationId">
						<option value="">全部</option>
						<#if stationList?? && stationList?size gt 0>
							<#list stationList as station>
								 <option value="${(station.stationId)!}" <#if (train.startStationId)?? && train.startStationId == station.stationId>selected</#if>>${(station.stationName)!}</option>
									</#list>
						</#if>
					</select>
				</div>
				<div class="content_seaever">
					<span>后方站:</span>
					<select name="afterStationId" id="afterStationId">
						<option value="">全部</option>
						<#if stationList?? && stationList?size gt 0>
							<#list stationList as station>
								 <option value="${(station.stationId)!}" <#if (train.afterStationId)?? && train.afterStationId == station.stationId>selected</#if>>${(station.stationName)!}</option>
							</#list>
						</#if>
					</select>
				</div>
				<div class="content_seaever">
					<span>前方站:</span>
					<select name="frontStationId" id="frontStationId">
						<option value="">全部</option>
						<#if stationList?? && stationList?size gt 0>
							<#list stationList as station>
								 <option value="${(station.stationId)!}" <#if (train.frontStationId)?? && train.frontStationId == station.stationId>selected</#if>>${(station.stationName)!}</option>
							</#list>
						</#if>
					</select>
				</div>
				<div class="content_seaever">
					<span>终到站:</span>
					<select name="endStationId" id="endStationId">
						<option value="">全部</option>
						<#if stationList?? && stationList?size gt 0>
							<#list stationList as station>
								 <option value="${(station.stationId)!}" <#if (train.endStationId)?? && train.endStationId == station.stationId>selected</#if>>${(station.stationName)!}</option>
							</#list>
						</#if>
					</select>
				</div>
				<div class="content_seaever">
					<span>接车股道:</span>
					<select name="pickUpTrack" id="pickUpTrack">
						<option value="">全部</option>
						<#if trackList?? && trackList?size gt 0>
							<#list trackList as track>
								 <option value="${(track.trackId)!}" <#if (train.pickUpTrack)?? && train.pickUpTrack == station.stationId>selected</#if>>${(track.trackOrder)!}G</option>
							</#list>
						</#if>
					</select>
				</div>
				 <div class="content_seaever">
					<span>发车股道:</span>
					<select name="leaveTrack" id="leaveTrack">
						<option value="">全部</option>
						<#if trackList?? && trackList?size gt 0>
							<#list trackList as track>
								 <option value="${(track.trackId)!}" <#if (train.leaveTrack)?? && train.leaveTrack == station.stationId>selected</#if>>${(track.trackOrder)!}G</option>
							</#list>
						</#if>
					</select>
				</div>
				
				<div class="content_seaever">
					<span>是否吸污:</span>
					<select name="isDealRubbisk" id="isDealRubbisk">
						<option value="">全部</option>
						<option value="0" <#if (train.isDealRubbisk)?? && train.isDealRubbisk == 0> selected </#if>>不需要</option>
						<option value="1" <#if (train.isDealRubbisk)?? && train.isDealRubbisk == 1> selected </#if>>需要</option>
					</select>
				</div>
				<div class="content_seaever">
					<span>是否上水:</span>
					<select name="isAddWater" id="isAddWater">
						<option value="">全部</option>
						<option value="0" <#if (train.isAddWater)?? && train.isAddWater == 0> selected </#if>>不需要</option>
						<option value="1" <#if (train.isAddWater)?? && train.isAddWater == 1> selected </#if>>需要</option>
					</select>
				</div>
				<div class="content_seaever_btn" onclick="searchList()"><img src="${staticPath}/image/search.png">搜索</div>
			</form>
			</div>
			<a class="content_seaever_btn" href="/train/addOrEdit"><img src="${staticPath}/image/search.png" alt="">新增</a>
		</div>
		<!--结果-->
		<div class="content_res">
			<table>
				<tr class="lan">
					<td>车次</td>
					<td>始发站</td>
					<td>终点站</td
					><td>是否上水</td>
					<td>是否吸污</td>
					<td>操作</td>
				</tr>
				<#if trainList?? && trainList?size gt 0>
					<#list trainList as train>
						 <tr>
							<td>${(train.trainName)!}</td>
							<td>${(train.startStationName)!}</td>
						   <td>${(train.endStationName)!}</td>
						   <td>
								<#if train.isAddWater?? && train.isAddWater == 0> 否 <#else> 是 </#if>
							</td>
						   <td>
								<#if train.isDealRubbisk?? && train.isDealRubbisk == 0> 否 <#else> 是 </#if>
							</td>
							<td>
								<div class="content_seaever_btn"  onclick="goedit(${train.trainId!})">
									<img src="${staticPath}/image/edit.png" alt="">编辑
								</div>
								<a class="content_seaever_btn" href="/train/info?trainId=${train.trainId!}">
									<img src="${staticPath}/image/see.png" alt="">查看
								</a>
							</td>
						</tr>
					</#list>
				</#if>
			</table>
		</div>
	</div>
	<script src="${staticPath}/js/android/cordova.js"></script>
	<script>
		
		document.addEventListener('deviceready', function () {
			goedit(traidId);
		
		},false)
		
		function goedit(traidId){
				 location.href="/train/addOrEdit?trainId="+traidId;
			}
		
		function searchList(){
			$("#searchForm").submit();
		}
		
			
		
		
	</script>
</body>
</html>